package com.qingjiang.projectschedule.utils;

import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Component
public class DoubleUtil {
    public static Double round(Double d,int places){
        BigDecimal bd = BigDecimal.valueOf(d);
        bd = bd.setScale(places, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }
}
